function FlashAction takes nothing returns nothing
	local unit caster = GetTriggerUnit()
	local unit target = GetSpellTargetUnit()
	local location targetLocaiotn = GetUnitLoc(target)
	local location finalLocation = PolarProjectionBJ(targetLocaiotn , 90.0 , AngleNormalize(GetUnitFacing(target) + 180.0))
	//--
	//call SetUnitPositionLoc(caster , finalLocation)
	call SetUnitX(caster , GetLocationX(finalLocation))
	call SetUnitY(caster , GetLocationY(finalLocation))
	call SetUnitFacing(caster , GetUnitFacing(target))
	call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" , finalLocation))
	call RemoveLocation(targetLocaiotn)
	call RemoveLocation(finalLocation)
	call UnitUsedAbilityWithDelta(caster , 'A01X' , 1.0)
	//--
	set caster = null
	set caster = null
	set targetLocaiotn = null
	set finalLocation = null
endfunction

function Trig_FlashTry takes nothing returns nothing
	if GetSpellAbilityId() == 'A01X' then
		call FlashAction()
	endif
endfunction

function InitTrig_Flash takes nothing returns nothing
	local hashtable masteryTable = InitHashtable()
	local integer abilityId = 'A01X'
	//--	
	call SaveInteger(udg_AbilityDataHashTable , abilityId , StringHash("NEXT_ABILITY") , 'A01Y')
	call SaveInteger(udg_AbilityDataHashTable , abilityId , StringHash("HOTKEY") , StringHash("Q"))
	call SaveStr(udg_AbilityDataHashTable , abilityId , StringHash("NAME") , "閃現")
	call SaveInteger(udg_AbilityDataHashTable , abilityId , StringHash("MAX_LEVEL") , 3)
	call SaveHashtableHandle(udg_AbilityDataHashTable , abilityId , StringHash("LEVEL_MASTERY_TABLE") , masteryTable)
	call SaveReal(masteryTable , 1 , 0 , 20.0)
	call SaveReal(masteryTable , 2 , 0 , 70.0)
	
	set gg_trg_Flash = CreateTrigger()
	call TriggerRegisterPlayerForceUnitEvent(gg_trg_Flash , EVENT_PLAYER_UNIT_SPELL_EFFECT)
	call TriggerAddAction(gg_trg_Flash , function Trig_FlashTry)
endfunction